<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ include file="index.jsp"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>
<body>
<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        租赁管理
        <span class="c-gray en">&gt;</span>
        显示器管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href)" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a> </nav>
    <div class="Hui-article">
        <article class="cl pd-20">    	
            
            <div class="cl pd-5 bg-1 bk-gray mt-20">
            	<shiro:hasPermission name="commodity">
                <span class="l">
                	<a onclick="lease_add('添加界面','xsqadd')" class="btn btn-primary radius">
                	<i class="Hui-iconfont">&#xe600;</i> 添加商品</a> 
                </span>
                </shiro:hasPermission>
            </div>
            
            <table class="table table-border table-bordered table-bg">
                <thead>
                <tr>
                    <th scope="col" colspan="13">显示器列表</th>
                </tr>
                <tr class="text-c">
                    <th width="40">ID</th>
                    <th width="90">显示器</th>
                    <th width="150">价格</th>
                    <shiro:hasPermission name="commodity">
                    <th width="100">操作</th>
                    </shiro:hasPermission>
                </tr>
                </thead>
                <tbody>
                	<c:forEach begin="0" step="1" items="${list}" var="list"
					varStatus="userlist">
		                <tr class="text-c">		
		                    <td>${userlist.count}</td>
		                    <td>${list.name }</td>
		                    <td>${list.price }</td>
		                    <shiro:hasPermission name="commodity">
		                    <td class="td-manage">
		                    <a title="编辑"  onclick="lease_edit('租赁信息编辑','xsqdeit?id=${list.id }')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> 
		                    <a title="删除" href="javascript:;" onclick="admin_del(this,'${list.id }')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
		                    </td>
		                    </shiro:hasPermission>
		                </tr>
                	</c:forEach>
                </tbody>
            </table>
        </article>
    </div>
</section>

<!--_表格--结束-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
   /*商品-删除*/
    function admin_del(obj,id){
        layer.confirm('确认要删除吗？',{ btn: ["确定","取消"] },function(index){
            $.ajax({
                type: 'POST',
                url: 'xsqdel',
                data:{id:id},
                dataType: 'json',
                success: function(val){
                	layer.close(index);
                	window.location.href = window.location.href;                	
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }
   
   
    //编辑修改租赁回收信息
    function lease_edit(title,url){
        var index = layer.open({
            type: 2,
            anim:3,
            title: title,
            area: [600+'px',300 +'px'],
            shade:0.2,
            content:url,
            end:function(){
            window.location.reload();
            }
        });
        
    }
    
    
    //编辑修改租赁回收信息
    function lease_add(title,url){
        var index = layer.open({
            type: 2,
            anim:3,
            title: title,
            area: [600+'px',300 +'px'],
            shade:0.2,
            content:url,
            end:function(){
            window.location.reload();
            }
        });
        
    }
</script>
</body>
</html>